@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig
    extends AbstractSecurityWebSocketMessageBrokerConfigurer {
    // ...
    @Override
    public void configureMessageBroker(
        MessageBrokerRegistry registry) {

        registry.enableStompBrokerRelay("/topic", "/queue")
            // set properties
        registry.setApplicationDestinationPrefixes("/app");
        registry.setUserDestinationPrefix("/user");
    }

    @Override
    public void registerStompEndpoints(
        StompEndpointRegistry registry) {

        registry.addEndpoint(
            "announcements",
            "comments",
            "questions").withSockJS();
    }

    @Override
    protected void customizeClientInboundChannel(
        ChannelRegistration registration) {
        registration.interceptors(jwtChannelInterceptor);
    }
}
